home *** CD-ROM | disk | FTP | other *** search
/ MacWorld Secrets (4th Edition) / Mac Secrets CD 4th Ed.toast / Apple Advanced Technologies / Apple Speech Technologies 1.5 / PlainTalk Developer Info / Speech Recognition Manager SDK / SR Sample Code / IM SR Example / MyInstallSpeechAEHandlers.c < prev    next >
C/C++ Source or Header  |  1996-09-18  |  712b  |  23 lines

  1. #include <SpeechRecognition.h>
  2. #include <AppleEvents.h>
  3.  
  4. OSErr    MyInstallSpeechAEHandlers (void);
  5.  
  6.  
  7. extern pascal OSErr MyHandleSpeechDetected (const AppleEvent *theAppleEvent, 
  8.                                     const AppleEvent * reply, long handlerRefcon);
  9. extern pascal OSErr MyHandleSpeechDone (const AppleEvent *theAppleEvent, 
  10.                                     const AppleEvent * reply, long handlerRefcon);
  11.  
  12. OSErr    MyInstallSpeechAEHandlers (void)
  13. {
  14.     OSErr                myErr = noErr;
  15.     
  16.     myErr = AEInstallEventHandler(kAESpeechSuite, kAESpeechDetected,
  17.                 NewAEEventHandlerProc(MyHandleSpeechDetected), 0, false);
  18.     
  19.     if (!myErr) myErr = AEInstallEventHandler(kAESpeechSuite, kAESpeechDone,
  20.                 NewAEEventHandlerProc(MyHandleSpeechDone), 0, false);
  21.     
  22.     return myErr;
  23. }